package com.itheima.homework;

import java.util.Scanner;

/*
 键盘录入一个字符串，统计该字符串中大写字母字符，
 小写字母字符，数字字符出现的次数(不考虑其他字符)
 */
public class Text4 {
    public static void main(String[] args) {
        int bigcount =0;
        int mincount =0;
        int numcount =0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串:");
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            char c = arr[i];
            if(c>'a'&&c<'z'){
                mincount++;
            }
            else if(c>'A'&&c<'Z'){
                bigcount++;
            }
            else if(c>'0'&& c<'9'){
                numcount++;
            }
        }
        System.out.println("大写共有:"+bigcount+"个");
        System.out.println("小写共有:"+mincount+"个");
        System.out.println("数字共有:"+numcount+"个");
    }
}
